home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
batch
/
TSBAT35.ARJ
/
SHOW.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-04-13
|
1KB
|
59 lines
echo off
rem This is a subroutine which show.bat calls by calling itself
rem Thus a second batch file is not needed
rem The subroutine displays a single file
if not "%2"=="recurse" goto _begin
echo File %1
type %1 | more
echo Strike a key for the next file . . .
pause > nul
goto _out
:_begin
echo.
echo ┌───────────────────────────────────────────────────┐
echo │ Type files allowing wildcards │
echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, 13-Apr-92 │
echo └───────────────────────────────────────────────────┘
echo.
rem If no parameters then give the instructions
if "%1"=="" goto _help
rem Check that show.bat is available at path or current directory
set _found=no
if exist show.bat set _found=yes
for %%d in (%path%) do if exist %%d\show.bat set _found=yes
if "%_found%"=="no" goto _no_show
rem Type the files
:_loop
if not exist %1 goto _err
for %%f in (%1) do %comspec% /e:1024 /c show %%f recurse
shift
if not "%1"=="" goto _loop
goto _out
rem Warn if file not found, then try the next
:_err
echo File(s) %1 not found
shift
if not "%1"=="" goto _loop
goto _out
:_no_show
echo You must have show.bat at your path (or the current directory)
goto _out
rem The instructions "(if everything else fails, then rtfm :-)"
:_help
echo Usage: SHOW [FirstFile] [SecondFile] [...]
echo.
echo Examples: SHOW c:\*.bat
echo SHOW tsbat.inf *.pas
echo.
rem That was the whole shebang
set _found=
:_out